%define debug_package %{nil}
%define _build 3230
%define java_version 11

Name:		ganttproject
Version:	3.2.%{_build}
Release:	1

License:	GPLv3
Summary:	Desktop tool for project scheduling and management
Group:		Office
Url:		http://www.ganttproject.biz

Source0:        https://github.com/bardsoftware/ganttproject/releases/download/%{name}-3.2.3200/%{name}-%{version}.zip?/%{name}-%{version}.zip
Source1:        %name.xml
Source2:        %name.png

Patch0:		export-openjfx-system-modules.patch

Requires:	openjfx17
Requires:	java-%{java_version}-openjdk
 
ExclusiveArch:  x86_64

%files
%license LICENSE
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name} 
%{_datadir}/mime/packages/%{name}.xml
%{_iconsdir}/hicolor/*/apps/*

#-------------------------------------------------------------------------------

%prep
%autosetup -p1

%build
# no build

%install
mkdir -p %{buildroot}%{_datadir}
cp -r %_builddir/%{name}-%{version} %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_datadir}/{applications,mime/packages}
mkdir -p %{buildroot}%{_iconsdir}/hicolor/64x64/apps
mkdir -p %{buildroot}%{_bindir}

install -m755 %{SOURCE1} %{buildroot}%{_datadir}/mime/packages/%{name}.xml
install -m755 %{SOURCE2} %{buildroot}%{_iconsdir}/hicolor/64x64/apps/%{name}.png

chmod +x %{buildroot}%{_datadir}/%{name}/%{name}
ln -sf %{_datadir}/%{name}/%{name} %{buildroot}%{_bindir}/%{name}

cat >> %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=GanttProject
GenericName=Project Management
GenericName[am]=የዕቅድ ጉባኤ
GenericName[ar]=إدارة المشاريع
GenericName[af]=Projekbestuur
GenericName[sq]=Menaxhim Projektesh
GenericName[hy]=Նախագծերի կառավարում
GenericName[ast]=Xestión de proyeutos
GenericName[eu]=Proiektu-kudeaketa
GenericName[be]=Кіраўнік праектаў
GenericName[bn]=প্রকল্প ব্যবস্থাপনা
GenericName[bs]=Upravljanje projektima
GenericName[pt_BR]=Gestão de projeto
GenericName[ca@valencia]=Gestió de projectes
GenericName[ca]=Gestió de projectes
GenericName[bg]=Управление на проекти
GenericName[zh_HK]=專案管理
GenericName[zh_TW]=專案管理
GenericName[crh]=Proje Yönetimi
GenericName[zh_CN]=项目管理
GenericName[hr]=Upravljanje projektima
GenericName[cs]=Správa projektů
GenericName[da]=Projekthåndtering
GenericName[nl]=Projectbeheer
GenericName[et]=Projektihaldus
GenericName[fi]=Projektinhallinta
GenericName[fr_CA]=Direction de projet
GenericName[gl]=Xestión de proxectos
GenericName[ka]=პროექტების მართვა
GenericName[de]=Projektverwaltung
GenericName[el]=Διαχείριση έργων
GenericName[fr]=Gestion de projets
GenericName[gu]=પ્રોજેક્ટ વ્યવસ્થાપન
GenericName[he]=ניהול פרוייקט
GenericName[hi]=प्रोजेक्ट प्रबंधन
GenericName[hu]=Projektmenedzsment
GenericName[is]=Verkstjórnun
GenericName[id]=Manajemen Proyek
GenericName[it]=Gestione progetti
GenericName[ja]=プロジェクト管理
GenericName[ky]=Долбоор башкаруу
GenericName[ko]=프로젝트 관리
GenericName[lv]=Projektu pārvaldība
GenericName[lt]=Projektų valdymas
GenericName[ms]=Pengurusan Projek
GenericName[ml]=പദ്ധതിനിര്‍വ്വഹണം
GenericName[mr]=प्रकल्प व्यवस्थापन
GenericName[ne]=परियोजना व्यवस्थापन
GenericName[nb]=Prosjektstyring
GenericName[oc]=Gestion de projèctes
GenericName[fa]=مدیریت پروژه
GenericName[pl]=Zarządzanie projektem
GenericName[sr]=Upravljanje Projektima
GenericName[ro]=Administrarea proiectelor
GenericName[ru]=Управление проектами
GenericName[pt]=Gestão de Projectos
GenericName[sk]=Správca projektov
GenericName[sl]=Upravljanje projektov
GenericName[ta]=திட்ட மேலாண்மை
GenericName[tg]=Идоракунии лоиҳаҳо
GenericName[es]=Gestión de proyectos
GenericName[sv]=Projekthantering
GenericName[th]=การบริหารโครงการ
GenericName[tr]=Proje Yönetimi
GenericName[uk]=Управління проектами
GenericName[vi]=Quản lý dự án
Comment=Project scheduling and management
Comment[ru]=Планирование и управление проектами
Exec=%{name}
Icon=%{name}
Type=Application
Categories=Office;Development;ProjectManagement;
EOF

%description
GanttProject is a cross-platform desktop tool for
project scheduling and management. 
It runs on Windows, Linux and MacOSX, it is free
and its code is opensource. 
It can do:
  * Gantt chart: create work breakdown structure,
                 draw dependencies, define milestones.
  * Resources: assign human resources to work on tasks,
               see their allocation on the Resource Load 
               chart.
  * PERT chart: generate PERT chart from Gantt chart.
  * Export: save charts as PNG images, generate PDF 
            and HTML reports.
  * Interoperate: import projects from and export them to
                  Microsoft Project formats.
                  Export to spreadsheets with CSV.
  * Collaborate: share projects with your colleagues
                 using WebDAV.
